package com.soft.base.contract;

import java.util.Map;
/**
 * class
 *
 * @author user
 * @date 2020/06/05
 */
public class Session {

    private Session() {
    }

    private static SessionFacade sessionFacade;

    public static synchronized void boot(SessionFacade sessionFacade) {
        Session.sessionFacade = sessionFacade;
    }


    public static String key() {
        return sessionFacade.key();
    }

    public static String key(String token) {
        return sessionFacade.key(token);
    }

    public static <T> void set(String name, T value) {
        sessionFacade.set(name, value);
    }

    public static Map<String, Object> all() {
        return sessionFacade.all();
    }

    public static <T> T get(String name) {
        return sessionFacade.get(name);
    }

    public static <T> T get(String name, String token) {
        return sessionFacade.get(name, token);
    }

    public static void forget(String name) {
        sessionFacade.forget(name);
    }
}
